package by.amakarevich.services;

import java.util.List;

import javax.persistence.metamodel.SingularAttribute;

import org.springframework.transaction.annotation.Transactional;

import by.amakarevich.datamodel.Booking;
import by.amakarevich.datamodel.UserAccount;

public interface BookingService {
	@Transactional
	void addNewBooking(Booking booking, UserAccount userAccount);
	
	@Transactional
	Booking get(Long id);
	
	@Transactional
	void updateBooking(Booking booking);
	
	@Transactional
    void deleteAll();
	
	List<Booking> getAllBookingByUser(UserAccount userAccount, boolean payStatus, boolean canceled);

    List<Booking> getSortedAllBooking(SingularAttribute<Booking, ?> attr, boolean ascending, int startRecord, int pageSize);
    
    @Transactional
    void deleteBooking(Long id);
    
    Long getCount();
    
    Booking getByBookingId(Long bookingId);
}
